package com.zhijiaoyun.model;

import java.io.Serializable;
import java.util.Date;

import com.zhijiaoyun.common.DateUtils;
import com.zhijiaoyun.common.StringUtils;

/**
 * @author shisfish
 * @date 2017/6/6
 */
public class User implements Serializable{
	private static final long serialVersionUID = 8406913254067956933L;

	private Long userId;

    private String username;

    private String realname;

    private String password;

    private String mobile;

    private String email;

    private Integer sex;

    private String birthday;

    private Integer age;

    private String headImg;

    private Long schoolId;

    private Long academyId;

    private Long majorId;
    
    private Integer status;

	/**
	 * 临时用户 1
	 * 普通用户 2
	 * 等级1 3
	 * 等级2 4
	 * ...
	 */
	private Integer vipStatus;

    private Date createTime;

    public class VipStatus {
    	public static final int TEMPORY = 1;
    	public static final int NORMAL = 2;
    	public static final int LEVEL_1 = 3;
    	public static final int LEVEL_2 = 4;
	}
    
    public User() {
		super();
	}

	public User(String username, String realname, String password, String mobile, String email, Integer sex,
			String birthday, Long schoolId, Long academyId, Long majorId, Integer status, Integer vipStatus) {
		super();
		this.username = username;
		this.realname = realname;
		this.password = password;
		this.mobile = mobile;
		this.email = email;
		this.sex = sex == null ? 0 : sex;
		if (!StringUtils.isEmptyString(birthday)) {
			this.birthday = birthday;
			this.age = DateUtils.getAge(birthday);
		}
		this.schoolId = schoolId == null ? 0 : schoolId;
		this.academyId = academyId == null ? 0 : academyId;
		this.majorId = majorId == null ? 0 : majorId;
		this.status = status == null ? 0 : status;
		this.vipStatus = vipStatus == null ? 0 : status;
		this.createTime = new Date();
	}

	public Long getUserId() {
		return userId;
	}

	public Long getSchoolId() {
		return schoolId;
	}

	public void setSchoolId(Long schoolId) {
		this.schoolId = schoolId;
	}

	public Long getAcademyId() {
		return academyId;
	}

	public void setAcademyId(Long academyId) {
		this.academyId = academyId;
	}

	public Long getMajorId() {
		return majorId;
	}

	public void setMajorId(Long majorId) {
		this.majorId = majorId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getRealname() {
		return realname;
	}

	public void setRealname(String realname) {
		this.realname = realname;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public Integer getSex() {
		return sex;
	}

	public void setSex(Integer sex) {
		this.sex = sex;
	}

	public String getBirthday() {
		return birthday;
	}

	public void setBirthday(String birthday) {
		this.birthday = birthday;
	}

	public Integer getAge() {
		return age;
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	public String getHeadImg() {
		return headImg;
	}

	public void setHeadImg(String headImg) {
		this.headImg = headImg;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Integer getVipStatus() {
		return vipStatus;
	}

	public void setVipStatus(Integer vipStatus) {
		this.vipStatus = vipStatus;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public static long getSerialVersionUID() {
		return serialVersionUID;
	}
    
}